home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Info-Mac 3
/
Info_Mac_1994-01.iso
/
User Interface
/
General
/
MacHack Loony Help
/
tt.c
< prev
next >
Wrap
C/C++ Source or Header
|
1992-06-18
|
2KB
|
120 lines
//
// © 1992 Marc Tamsky
// MacHack '92 Ann Arbor, MI
// Created: Thursday, 18 June.Time: 6:05am after 4 Hours of playing Bolo, Spectre and NetHack!
// LoonyHelp
// a
// nifty little utility for changing the way help baloons work
// i.e. make them animate!
/************/
#include <Types.h>
#include <Traps.h>
#include <SysEqu.h>
#include <quickdraw.h>
#include <Menus.h>
#include <Windows.h>
#include <Processes.h>
#include <Resources.h>
#include <Notification.h>
#include <Memory.h>
#include <stdio.h>
#include <Balloons.h>
/************/
// #pragma dump "ttdump" this broke recently.....added more memory....did it help?
killBalloonMenu()
// not used but included for you fun loving people who love to kill things!
{
MenuHandle fTesthandle;
if( fTesthandle = GetMHandle(-16490))
{
DeleteMenu(-16490);
DisposeMenu(fTesthandle);
}
}
PlotSICN(short SICNid, short index, Point location)
{
Handle mySICN;
BitMap myImage;
Rect myRect;
int err;
mySICN = Get1Resource('SICN',SICNid);
if(err = ResError()) { DebugStr("\pToo bad, couldn't get a needed SICN"); }
HLock(mySICN);
myImage.baseAddr = *mySICN + (index - 1 ) * 32;
myImage.rowBytes = 2;
SetRect(&myRect, location.h, location.v,
location.h+16, location.v+16);
myImage.bounds.left = myRect.left;
myImage.bounds.right = myRect.right;
myImage.bounds.top = myRect.top;
myImage.bounds.bottom = myRect.bottom;
CopyBits(&myImage, &(qd.thePort->portBits), &myRect, &myRect, srcCopy, NULL );
HUnlock(mySICN);
}
//Notes:
// #define GetGrayRgn() (* (RgnHandle*) 0x09EE)
#define MenuList (short *)*(MenuHandle)*(0xA1C)
nextIcon()
{
unsigned short numberOfMenus,balloonEdge;
static int i=0;
GrafPtr oldPort,newPort;
Point drawPoint;
HLock(*(Handle*)0xA1C);
numberOfMenus = ***(short ***)(0xA1C); // actually its nummenus*6
balloonEdge = *(short*)(**(char ***)(0xA1C) + numberOfMenus - 8 + 6);
HUnlock(*(Handle*)0xA1C);
GetPort(&oldPort);
GetWMgrPort(&newPort);
SetPort(newPort);
OffsetRgn(GetGrayRgn(),0,-MBarHeight);
drawPoint.h = balloonEdge + 7;
drawPoint.v = 2;
i++;
if (i>7) i=0;
PlotSICN(128,1+i,drawPoint);
OffsetRgn(GetGrayRgn(),0,MBarHeight);
SetPort(oldPort);
}
main()
{
EventRecord myEvents;
long tt;
InitGraf(&qd.thePort);
InitWindows();
InitCursor();
while(!Button()) {
WaitNextEvent(0,&myEvents,60,0);
if(HMGetBalloons() && !HMIsBalloon()) {
nextIcon();
Delay(5,&tt);
}
}
}